# NextStateBasedOn

Specifies how the button changes states:

- Current state - the application switches the button from the current state to the next state and writes out the next state value.
- Value connection - the application reads the value of the Value connection, and, if the value matches one of the button’s state values, changes the button to the next state and writes out the next state value. Select this option if you want the button to base its state on external changes to the Value connection.

If the value does not match one of the button’s state values, the application changes the button to State 0 and writes out the State 0 value. When the button is in its last configured state, pressing it causes the button to change to State 0 and write out the State 0 value.